var t = require;
var e = module;
var o = exports;
var n =
        (this && this.__extends) ||
        (function () {
            var t = function (e, o) {
                return (t =
                    Object.setPrototypeOf ||
                    ({__proto__: []} instanceof Array &&
                        function (t, e) {
                            t.__proto__ = e;
                        }) ||
                    function (t, e) {
                        for (var o in e) e.hasOwnProperty(o) && (t[o] = e[o]);
                    })(e, o);
            };
            return function (e, o) {
                function n() {
                    this.constructor = e;
                }
                t(e, o), (e.prototype = null === o ? Object.create(o) : ((n.prototype = o.prototype), new n()));
            };
        })(),
    r =
        (this && this.__decorate) ||
        function (t, e, o, n) {
            var r,
                a = arguments.length,
                i = a < 3 ? e : null === n ? (n = Object.getOwnPropertyDescriptor(e, o)) : n;
            if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) i = Reflect.decorate(t, e, o, n);
            else
                for (var s = t.length - 1; s >= 0; s--)
                    (r = t[s]) && (i = (a < 3 ? r(i) : a > 3 ? r(e, o, i) : r(e, o)) || i);
            return a > 3 && i && Object.defineProperty(e, o, i), i;
        };
Object.defineProperty(o, "__esModule", {value: !0});
var a = t("GameData"),
    i = t("OnClick"),
    s = t("SpriteLoad"),
    c = t("SwitchSprite"),
    l = t("Util"),
    u = t("ConfS"),
    p = cc._decorator,
    f = p.ccclass,
    d = p.property,
    h = (function (t) {
        function e() {
            var e = (null !== t && t.apply(this, arguments)) || this;
            return (
                (e.text = null),
                (e.icon = null),
                (e.count = null),
                (e.signedin = null),
                (e.onclick = null),
                (e.ss = null),
                e
            );
        }
        var o;
        return (
            n(e, t),
            (o = e),
            (e.prototype.onEnable = function () {
                (this.index = this.node.parent.children.indexOf(this.node)),
                    (this.data = u.DatasManager.SignDatas[this.index]),
                    (this.text.string = "第" + o.list[this.index] + "天"),
                    (this.icon.url.value = this.data.icon),
                    (this.count.string = "x" + this.data.Need),
                    (this.onclick.clickpar = this.index),
                    a.default.on("连续签到的次数", this, this.onChange, !0);
            }),
            (e.prototype.onChange = function () {
                (this.signedin.active = this.index < a.default.连续签到的次数),
                    l.is今天(a.default.上一次签到的时间戳) || this.index != a.default.连续签到的次数
                        ? (this.ss.index = 0)
                        : (this.ss.index = 1);
            }),
            (e.prototype.onDisable = function () {
                a.default.off("连续签到的次数", this, this.onChange);
            }),
            (e.list = ["一", "二", "三", "四", "五", "六", "七"]),
            r([d(cc.Label)], e.prototype, "text", void 0),
            r([d(s.default)], e.prototype, "icon", void 0),
            r([d(cc.Label)], e.prototype, "count", void 0),
            r([d(cc.Node)], e.prototype, "signedin", void 0),
            r([d(i.default)], e.prototype, "onclick", void 0),
            r([d(c.default)], e.prototype, "ss", void 0),
            (e = o = r([f], e))
        );
    })(cc.Component);
o.default = h;
